package com.ml.mall.mapper.common;

import com.ml.mall.entity.seq.SysSeq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * Created by kyyang on 2021/1/17 16:42
 */
@Mapper
@Repository
public interface CommonSeqMapper {


    @Select("select seq_name as seqName ,current_val as currentVal,increment_val as incrementVal,prefix from sys_seq where seq_name = #{seqName}")
    SysSeq curSysOrderSeq(@Param("seqName") String seqName);

    @Update("update sys_seq set current_val = current_val + increment_val  where seq_name = #{seqName}")
    int updateSysOrderSeq(@Param("seqName") String seqName);
}
